<template>
  <div id="client">
    <p style="position: relative; right: 180px; scale: 0.8; width: 1700px">
      <span class="demonstration" style="margin-left: 20px">有效日期：</span>
      <el-date-picker
        v-model="value2"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        :picker-options="pickerOptions"
      >
      </el-date-picker>
      &nbsp;&nbsp;&nbsp; 单据编号：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="单据编号"
        v-model="input"
        clearable
      >
      </el-input>
      &nbsp;&nbsp;&nbsp; 供应商：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入供应商"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp; 采购人员：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入采购人员"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp;
      <el-button type="primary">查询</el-button>
    </p>
    <p style="float: right; scale: 0.8; margin-top: 20px; margin-right: 60px">
      <el-button >发票登记</el-button>
      <el-button @click="goto('Indoc')">开票记录</el-button>
      <el-button>导出</el-button>
      <el-divider></el-divider>
    </p>
    <el-table
      height="300px"
      :data="tableData"
      border
      style="width: 100%; font-size: 13px"
    show-summary>
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="date" label="单据日期" width="150">
      </el-table-column>
      <el-table-column prop="ordersId" label="单据编号" width="120">
      </el-table-column>
      <el-table-column prop="orderId" label="关联购货订单号" width="120">
      </el-table-column>
      <el-table-column prop="client" label="供应商" width="120">
      </el-table-column>
      <el-table-column prop="totalmoney" label="金额" width="120">
      </el-table-column>
      <el-table-column prop="totalmoney" label="数量" width="120">
      </el-table-column>
      <el-table-column prop="sellman" label="采购人员" width="120">
      </el-table-column>
      <el-table-column prop="getMoney" label="已付款" width="120">
      </el-table-column>
      <el-table-column prop="piaoMoney" label="已开票金额" width="120">
      </el-table-column>
      <el-table-column prop="nopiaoMoney" label="未开票金额" width="120">
      </el-table-column>
      <el-table-column prop="nowpiaoMoney" label="本次开票金额" width="120">
      </el-table-column>
      <el-table-column prop="mytext" label="备注" width="120">
      </el-table-column>
    </el-table>
    <p style="scale: 0.8; margin-top: 10px; margin-bottom: 10px">
      开票日期：
      <el-date-picker
        v-model="value3"
        type="datetime"
        placeholder="选择日期时间"
        default-time="12:00:00"
      >
      </el-date-picker
      >&nbsp;&nbsp;&nbsp; 发票号：<el-input
        style="width: 240px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
      发票金额：<el-input
        style="width: 240px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
    </p>
    <p style="scale: 0.8">
      发票抬头：<el-input
        style="width: 240px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
      开票备注：<el-input
        style="width: 240px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
      销售方：<el-input
        style="width: 240px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
    </p>
    <el-dialog top="20px" title="新增客户" :visible.sync="dialogFormVisible">
      <AddClient />
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <div style="height: 20px; clear: both"></div>
    <el-dialog top="20px" title="添加发票" :visible.sync="dialogFormVisible">
      <el-input
        v-model="input"
        placeholder="请输入编号或名称"
        style="width: 200px; margin-left: 20px"
      ></el-input>
      <el-checkbox v-model="checked" style="margin-left: 20px"
        >显示禁用职员</el-checkbox
      >
      <el-button type="success" style="margin-left: 20px">查询</el-button>
      <el-table :data="gridData">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          width="100"
          property="name"
          label="类别"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="编号"
        ></el-table-column>
        <el-table-column
          width="300"
          property="address"
          label="名称"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="联系人"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="手机"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="备注"
        ></el-table-column>
      </el-table>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "Invoicing",
  data() {
    return {
      goto(to) {
        if (this.$route.path !== "/" + to) {
          this.$router.push(to);
        }
      },
      dialogFormVisible: false,
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      value2: "",
    };
  },
  methods: {
    goto(to) {
      this.$router.push(to);
    },
  },
};
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>